<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<title>04-tests</title>
        <script type="text/javascript" src="js/mu.js" charset="utf-8"></script>
</head>

<body>

<script id="code">
/*--- START ---*/
function Human(){

    var name = "John Doe";
    //Constructor
    this.Human = function(pname){
        if(pname!=undefined){name = pname;}
    }

    this.getName = function(){
            return name;
    }

    this.setName = function(value){
            name = value;
    }
}

function Man(){

    $(this).Extends(Human);

    var nickName;

    this.Man = function(pnickname){
            //this.Human(name);
            nickName = pnickname;

            //increment static variable
            Man.Count+=1;
    }

    this.getNickName = function(){
            return nickName;
    }

    this.setNickName = function(value){
            nickName = value;
    }

    this.hello = function(){
            console.log("Hello, I am " + this.getName() + " aka "+ this.getNickName());
    }
}
//Static
Man.Count = 0;

var someone = $(Human).New();
console.log("Some one : " + someone.getName());
//someone.setName("SOMEONE");

var bob = $(Man).New();
console.log("Bob : " + bob.getName());
bob.setName("BOB");

console.log("Some one : " + someone.getName());
console.log("Bob : " + bob.getName());

someone.setName("SOMEONE");
console.log("Some one : " + someone.getName());
console.log("Bob : " + bob.getName());

var sam = $(Man).New("Sam");
var bill = $(Man).New("Billou");
bill.setName("Bill");

bob.hello();
sam.hello();
bill.hello();

sam.setNickName("Samy"); sam.setName("SAM THE PIRATE");
bob.setNickName("Boby");

bob.hello();
sam.hello();
bill.hello();

console.log(Man.Count);

console.log(bob.constructor.name);
console.log(someone.constructor.name);

console.log($(bob).Is(Man));
console.log($(bob).Is(Human));
console.log($(someone).Is(Man));
console.log($(someone).Is(Human));


/*--- END ---*/
</script>

</body>
</html>
